package com.xc.easyExcel;

import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.io.File;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        File file = new File("D:\\person\\WeChat Files\\wxid_xvjtlx70b8b922\\FileStorage\\File\\2024-04\\绵阳台沃导入表格-new.xlsx");
        EasyExcel.read(file, new AnalysisEventListener() {
            @Override
            public void invoke(Object object, AnalysisContext analysisContext) {
                Map<String, Object> map = (Map) object;
                if (CollUtil.isEmpty(map)) {
                    return;
                }
                System.out.println(map.keySet());
                System.out.println(map.values());
            }

            @Override
            public void doAfterAllAnalysed(AnalysisContext analysisContext) {

            }
        }).sheet(1).headRowNumber(3).doRead();
    }
}
